﻿namespace Sidvall.Web.Security
{
    public class UserEmailValidatorFactoryContext
    {
        #region Public Members

        public string AuthorityUserInfoEndpoint { get; set; }
        public System.Collections.ObjectModel.Collection<string> IgnoredUsers { get; set; }

        #region Deserialize

        public static UserEmailValidatorFactoryContext Deserialize(string value)
        {
            return Deserialize(value, null);
        }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
        public static UserEmailValidatorFactoryContext Deserialize(string value, UserEmailValidatorFactoryContext defaultValue)
        {
            return Sidvall.Serialization.SerializerManager.Current.TryDeserialize<UserEmailValidatorFactoryContext>(value, () =>
            {
                return defaultValue;
            });
        }

        #endregion
        #region Serialize

        public string Serialize()
        {
            return Serialize(this);
        }
        public static string Serialize(UserEmailValidatorFactoryContext context)
        {
            return Sidvall.Serialization.SerializerManager.Current.SerializeObject(context);
        }

        #endregion

        #endregion
    }
}
